package cn.neusoft.yuejian307.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

import cn.neusoft.yuejian307.R;

public class TrainDetail extends AppCompatActivity {
    private MyTitle myTitle;
    private TextView a2,a3,a4,a5,a6,a7;
    private ImageView a1;
    private Bundle bundle;
    private int id;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_train_detail);
        Intent intent  =  getIntent();
        bundle = intent.getExtras();
        init();

    }
    private void init(){
        myTitle = (MyTitle)findViewById(R.id.tt);
        myTitle.setTitle("培训详情");
        id = bundle.getInt("1");
        a1 = (ImageView)findViewById(R.id.a1);
        Picasso.with(TrainDetail.this).load(bundle.getString("2")).into(a1);
        a2 = (TextView)findViewById(R.id.a2);
        a2.setText(bundle.getString("3"));
        a3 = (TextView)findViewById(R.id.a3);
        a3.setText(bundle.getString("4"));
        a4 = (TextView)findViewById(R.id.a4);
        a4.setText(bundle.getString("5"));
        a5 = (TextView)findViewById(R.id.a5);
        a5.setText(bundle.getString("6"));
        a6 = (TextView)findViewById(R.id.a6);
        a6.setText(bundle.getString("7"));
        a7 = (TextView)findViewById(R.id.a7);
        a7.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(TrainDetail.this,TrainAplly.class);
                intent.putExtra("s1",id+"");
                intent.putExtra("s2",bundle.getString("2"));
                intent.putExtra("s3",bundle.getString("8"));
                intent.putExtra("s4",bundle.getString("7"));
                intent.putExtra("s5",bundle.getString("4"));
                startActivity(intent);
            }
        });

    }
}
